﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using XCode;
using BingZi.HY.Core;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace BingZi.HY.Core
{
	/// <summary>
	/// 系统日记表
	/// </summary>
	[Serializable]
	[DataObject]
    [BindIndex("PK_SYS_EventID", true, "EventID")]
	[Description("系统日记表")]
    [BindTable("sys_Event", Description = "系统日记表", ConnName = "System")]
    public partial class sys_Event : Isys_Event
    {
        #region 属性
        private Int32 _EventID;
        /// <summary>事件ID号</summary>
        [DisplayName("事件ID号")]
        [Description("事件ID号")]
        [DataObjectField(true, true, false, 10)]
        [BindColumn(1, "EventID", "事件ID号", null, "int", 10, 0, false)]
        public Int32 EventID
        {
            get { return _EventID; }
            set { if (OnPropertyChanging("EventID", value)) { _EventID = value; OnPropertyChanged("EventID"); } }
        }

        private String _E_U_LoginName = String.Empty;
        /// <summary>用户名</summary>
        [DisplayName("用户名")]
        [Description("用户名")]
        [DataObjectField(false, false, true, 20)]
        [BindColumn(2, "E_U_LoginName", "用户名", "", "nvarchar(20)", 0, 0, true)]
        public String E_U_LoginName
        {
            get { return _E_U_LoginName; }
            set { if (OnPropertyChanging("E_U_LoginName", value)) { _E_U_LoginName = value; OnPropertyChanged("E_U_LoginName"); } }
        }

        private Int32 _E_UserID;
        /// <summary>操作时用户ID与sys_Users中UserID</summary>
        [DisplayName("操作时用户ID与sys_Users中UserID")]
        [Description("操作时用户ID与sys_Users中UserID")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn(3, "E_UserID", "操作时用户ID与sys_Users中UserID", null, "int", 10, 0, false)]
        public Int32 E_UserID
        {
            get { return _E_UserID; }
            set { if (OnPropertyChanging("E_UserID", value)) { _E_UserID = value; OnPropertyChanged("E_UserID"); } }
        }

        private DateTime _E_DateTime = DateTime.Now;
        /// <summary>事件发生的日期及时间</summary>
        [DisplayName("事件发生的日期及时间")]
        [Description("事件发生的日期及时间")]
        [DataObjectField(false, false, false, 3)]
        [BindColumn(4, "E_DateTime", "事件发生的日期及时间", "", "datetime", 3, 0, false)]
        public DateTime E_DateTime
        {
            get { return _E_DateTime; }
            set { if (OnPropertyChanging("E_DateTime", value)) { _E_DateTime = value; OnPropertyChanged("E_DateTime"); } }
        }

        private Int32 _E_ApplicationID;
        /// <summary>所属应用程序ID与sys_Applicatio</summary>
        [DisplayName("所属应用程序ID与sys_Applicatio")]
        [Description("所属应用程序ID与sys_Applicatio")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn(5, "E_ApplicationID", "所属应用程序ID与sys_Applicatio", "0", "int", 10, 0, false)]
        public Int32 E_ApplicationID
        {
            get { return _E_ApplicationID; }
            set { if (OnPropertyChanging("E_ApplicationID", value)) { _E_ApplicationID = value; OnPropertyChanged("E_ApplicationID"); } }
        }

        private String _E_A_AppName = String.Empty;
        /// <summary>所属应用名称</summary>
        [DisplayName("所属应用名称")]
        [Description("所属应用名称")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn(6, "E_A_AppName", "所属应用名称", "", "nvarchar(50)", 0, 0, true)]
        public String E_A_AppName
        {
            get { return _E_A_AppName; }
            set { if (OnPropertyChanging("E_A_AppName", value)) { _E_A_AppName = value; OnPropertyChanged("E_A_AppName"); } }
        }

        private String _E_M_Name = String.Empty;
        /// <summary>PageCode模块名称与sys_Module相同</summary>
        [DisplayName("PageCode模块名称与sys_Module相同")]
        [Description("PageCode模块名称与sys_Module相同")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn(7, "E_M_Name", "PageCode模块名称与sys_Module相同", "", "nvarchar(50)", 0, 0, true)]
        public String E_M_Name
        {
            get { return _E_M_Name; }
            set { if (OnPropertyChanging("E_M_Name", value)) { _E_M_Name = value; OnPropertyChanged("E_M_Name"); } }
        }

        private String _E_M_PageCode = String.Empty;
        /// <summary>发生事件时模块名称</summary>
        [DisplayName("发生事件时模块名称")]
        [Description("发生事件时模块名称")]
        [DataObjectField(false, false, true, 6)]
        [BindColumn(8, "E_M_PageCode", "发生事件时模块名称", "", "varchar(6)", 0, 0, false)]
        public String E_M_PageCode
        {
            get { return _E_M_PageCode; }
            set { if (OnPropertyChanging("E_M_PageCode", value)) { _E_M_PageCode = value; OnPropertyChanged("E_M_PageCode"); } }
        }

        private String _E_From = String.Empty;
        /// <summary>来源</summary>
        [DisplayName("来源")]
        [Description("来源")]
        [DataObjectField(false, false, true, 500)]
        [BindColumn(9, "E_From", "来源", "", "nvarchar(500)", 0, 0, true)]
        public String E_From
        {
            get { return _E_From; }
            set { if (OnPropertyChanging("E_From", value)) { _E_From = value; OnPropertyChanged("E_From"); } }
        }

        private Int32 _E_Type;
        /// <summary>日记类型,1:操作日记2:安全日志3</summary>
        [DisplayName("日记类型,1:操作日记2:安全日志3")]
        [Description("日记类型,1:操作日记2:安全日志3")]
        [DataObjectField(false, false, false, 3)]
        [BindColumn(10, "E_Type", "日记类型,1:操作日记2:安全日志3", "1", "tinyint", 3, 0, false)]
        public Int32 E_Type
        {
            get { return _E_Type; }
            set { if (OnPropertyChanging("E_Type", value)) { _E_Type = value; OnPropertyChanged("E_Type"); } }
        }

        private String _E_IP = String.Empty;
        /// <summary>客户端IP地址</summary>
        [DisplayName("客户端IP地址")]
        [Description("客户端IP地址")]
        [DataObjectField(false, false, true, 15)]
        [BindColumn(11, "E_IP", "客户端IP地址", "", "varchar(15)", 0, 0, false)]
        public String E_IP
        {
            get { return _E_IP; }
            set { if (OnPropertyChanging("E_IP", value)) { _E_IP = value; OnPropertyChanged("E_IP"); } }
        }

        private String _E_Record = String.Empty;
        /// <summary>详细描述</summary>
        [DisplayName("详细描述")]
        [Description("详细描述")]
        [DataObjectField(false, false, true, 500)]
        [BindColumn(12, "E_Record", "详细描述", "", "nvarchar(500)", 0, 0, true)]
        public String E_Record
        {
            get { return _E_Record; }
            set { if (OnPropertyChanging("E_Record", value)) { _E_Record = value; OnPropertyChanged("E_Record"); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "EventID": return _EventID;
                    case "E_U_LoginName": return _E_U_LoginName;
                    case "E_UserID": return _E_UserID;
                    case "E_DateTime": return _E_DateTime;
                    case "E_ApplicationID": return _E_ApplicationID;
                    case "E_A_AppName": return _E_A_AppName;
                    case "E_M_Name": return _E_M_Name;
                    case "E_M_PageCode": return _E_M_PageCode;
                    case "E_From": return _E_From;
                    case "E_Type": return _E_Type;
                    case "E_IP": return _E_IP;
                    case "E_Record": return _E_Record;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "EventID": _EventID = Convert.ToInt32(value); break;
                    case "E_U_LoginName": _E_U_LoginName = Convert.ToString(value); break;
                    case "E_UserID": _E_UserID = Convert.ToInt32(value); break;
                    case "E_DateTime": _E_DateTime = Convert.ToDateTime(value); break;
                    case "E_ApplicationID": _E_ApplicationID = Convert.ToInt32(value); break;
                    case "E_A_AppName": _E_A_AppName = Convert.ToString(value); break;
                    case "E_M_Name": _E_M_Name = Convert.ToString(value); break;
                    case "E_M_PageCode": _E_M_PageCode = Convert.ToString(value); break;
                    case "E_From": _E_From = Convert.ToString(value); break;
                    case "E_Type": _E_Type = Convert.ToInt32(value); break;
                    case "E_IP": _E_IP = Convert.ToString(value); break;
                    case "E_Record": _E_Record = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得系统日记表字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>事件ID号</summary>
            public static readonly FieldItem EventID = Meta.Table.FindByName("EventID");

            ///<summary>用户名</summary>
            public static readonly FieldItem E_U_LoginName = Meta.Table.FindByName("E_U_LoginName");

            ///<summary>操作时用户ID与sys_Users中UserID</summary>
            public static readonly FieldItem E_UserID = Meta.Table.FindByName("E_UserID");

            ///<summary>事件发生的日期及时间</summary>
            public static readonly FieldItem E_DateTime = Meta.Table.FindByName("E_DateTime");

            ///<summary>所属应用程序ID与sys_Applicatio</summary>
            public static readonly FieldItem E_ApplicationID = Meta.Table.FindByName("E_ApplicationID");

            ///<summary>所属应用名称</summary>
            public static readonly FieldItem E_A_AppName = Meta.Table.FindByName("E_A_AppName");

            ///<summary>PageCode模块名称与sys_Module相同</summary>
            public static readonly FieldItem E_M_Name = Meta.Table.FindByName("E_M_Name");

            ///<summary>发生事件时模块名称</summary>
            public static readonly FieldItem E_M_PageCode = Meta.Table.FindByName("E_M_PageCode");

            ///<summary>来源</summary>
            public static readonly FieldItem E_From = Meta.Table.FindByName("E_From");

            ///<summary>日记类型,1:操作日记2:安全日志3</summary>
            public static readonly FieldItem E_Type = Meta.Table.FindByName("E_Type");

            ///<summary>客户端IP地址</summary>
            public static readonly FieldItem E_IP = Meta.Table.FindByName("E_IP");

            ///<summary>详细描述</summary>
            public static readonly FieldItem E_Record = Meta.Table.FindByName("E_Record");
        }
        #endregion
    }

    /// <summary>系统日记表接口</summary>
    public partial interface Isys_Event
    {
        #region 属性
        /// <summary>事件ID号</summary>
        Int32 EventID { get; set; }

        /// <summary>用户名</summary>
        String E_U_LoginName { get; set; }

        /// <summary>操作时用户ID与sys_Users中UserID</summary>
        Int32 E_UserID { get; set; }

        /// <summary>事件发生的日期及时间</summary>
        DateTime E_DateTime { get; set; }

        /// <summary>所属应用程序ID与sys_Applicatio</summary>
        Int32 E_ApplicationID { get; set; }

        /// <summary>所属应用名称</summary>
        String E_A_AppName { get; set; }

        /// <summary>PageCode模块名称与sys_Module相同</summary>
        String E_M_Name { get; set; }

        /// <summary>发生事件时模块名称</summary>
        String E_M_PageCode { get; set; }

        /// <summary>来源</summary>
        String E_From { get; set; }

        /// <summary>日记类型,1:操作日记2:安全日志3</summary>
        Int32 E_Type { get; set; }

        /// <summary>客户端IP地址</summary>
        String E_IP { get; set; }

        /// <summary>详细描述</summary>
        String E_Record { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}